Benjamin Otte [Wed, 29 Mar 2023 08:33:51 +0000 (10:33 +0200)]
columnview: Implement inertness
This properly implements the same behavior as
62e9d1e470b0819bdcb4d2a3ba05e083306fc0da and avoids randomly losing
factories.
Oops.
Benjamin Otte [Wed, 29 Mar 2023 06:34:40 +0000 (08:34 +0200)]
Benjamin Otte [Mon, 27 Mar 2023 18:53:48 +0000 (20:53 +0200)]
columnview: Rename to GtkColumnViewCellWidget
Just like with Row/RowWidget, I want to use Cell/CellWidget.
Benjamin Otte [Mon, 27 Mar 2023 02:36:22 +0000 (04:36 +0200)]
columnview: Add GtkColumnViewRow
There is no way to set it yet, this is just to prove that it works.
It also changes the focus behavior of rows. They are now always
focusable - unless turned off by the factory once that is possible.
Benjamin Otte [Sun, 26 Mar 2023 18:51:27 +0000 (20:51 +0200)]
listitem: Add a backwards compatibility workaround
I want to avoid turning the :focusable property into a tristate at all
costs, but that third state is what we had before the property.
Benjamin Otte [Sun, 26 Mar 2023 19:06:09 +0000 (21:06 +0200)]
treeexpander: Add docs note about setting GtkListItem::focusable
Benjamin Otte [Mon, 27 Mar 2023 20:03:13 +0000 (22:03 +0200)]
columnviewcell: Cells should not be focusable by default
Benjamin Otte [Sat, 25 Mar 2023 23:50:45 +0000 (00:50 +0100)]
listview: Add GtkListItem::focusable property
This makes the question if a listitem can be focused or not an explicit
decision by application developers.
Previously an item could be focused if it was selectable and no child or
grandchild was focusable - so if you put a label and icon into it, the
item was focusable, but if you put a GtkTreeExpander or a GtkButton into
it, the item wasn't. This needs to be decided explicitly now.
Technically this is an API break, because the previous behavior does not
exist anymore.
But I really don't want to make this a tristate (focusable, not
focusable, automatic), because then binding it to other things gets
hard, and because all the other focusable proeprties are booleans, too,
and working with them gets a lot harder.
Related: #3910
Benjamin Otte [Mon, 27 Mar 2023 20:04:14 +0000 (22:04 +0200)]
columnviewcell: Cells aren't selectable or activatable
Rows are.
Benjamin Otte [Fri, 31 Mar 2023 21:42:15 +0000 (23:42 +0200)]
listitem: Use GDK_DECLARE_INTERNAL_TYPE
Matthias Clasen [Sat, 1 Apr 2023 18:36:39 +0000 (18:36 +0000)]
Merge branch 'matthiasc/for-main' into 'main'
inspector: Update some misc info rows
See merge request GNOME/gtk!5768
Matthias Clasen [Sat, 1 Apr 2023 18:35:33 +0000 (18:35 +0000)]
Merge branch 'wip/otte/fractional-cairo' into 'main'
wayland: Enable fractional scaling with the Cairo renderer
See merge request GNOME/gtk!5767
Georges Basile Stavracas Neto [Sat, 1 Apr 2023 18:23:12 +0000 (18:23 +0000)]
Merge branch 'gbsneto/mildly-mid-vulkan-fixes' into 'main'
Vulkan transform / scale fixes
See merge request GNOME/gtk!5757
Matthias Clasen [Sat, 1 Apr 2023 18:18:27 +0000 (14:18 -0400)]
inspector: Update some misc info rows
Benjamin Otte [Sat, 1 Apr 2023 15:25:33 +0000 (17:25 +0200)]
wayland: Use fractional scaling with the Cairo renderer
Cairo can do that, so just enable it:
* Create surfaces with the correct fractionally scaled size.
* Set the Cairo surface's device scale to that number.
Benjamin Otte [Sat, 1 Apr 2023 14:09:38 +0000 (16:09 +0200)]
wayland: Allow creating fractional Cairo surfaces
We don't do that yet, because the buffer scale code can't deal with it,
but we can do it now.
Benjamin Otte [Sat, 1 Apr 2023 11:59:52 +0000 (13:59 +0200)]
build: Bump wayland-protocols requirement
The new fractional-scale support requires v1.31
Benjamin Otte [Sat, 1 Apr 2023 12:41:30 +0000 (14:41 +0200)]
wayland: Use wp_viewport to set buffer scale
Instead of setting the buffer scale via the buffer-scale command, set it
via the viewport.
This technically allows setting fractional scales, but we're not doing
that.
Georges Basile Stavracas Neto [Sat, 1 Apr 2023 14:38:22 +0000 (11:38 -0300)]
gsk/gl/renderjob: Decompose matrix for 3D transforms
While this can be more expensive, it's also correct.
Georges Basile Stavracas Neto [Fri, 24 Mar 2023 01:30:12 +0000 (22:30 -0300)]
gsk/vulkan/renderpass: Update scales from transform node
Retrieve the scale from the transform node, and store it as long
as the transform node is being visited. This applies the proper
scale to text nodes.
Georges Basile Stavracas Neto [Fri, 24 Mar 2023 01:26:14 +0000 (22:26 -0300)]
gsk/vulkan/renderpass: Refactor scale
Instead of tracking a single scale, track x and y scales separately.
Factor out gsk_vulkan_render_pass_new() into a private function that
receives both scales, and pass 'scale_factor' for both.
Matthias Clasen [Sat, 1 Apr 2023 14:29:25 +0000 (10:29 -0400)]
NEWS: Updates
Benjamin Otte [Sat, 1 Apr 2023 11:40:14 +0000 (13:40 +0200)]
wayland: Use GdkFractionalScale for surface scale
We still always round it to integers when we read it, but we store it as a fraction.
So we could now use it for fractional scaling.
Benjamin Otte [Sat, 1 Apr 2023 15:31:47 +0000 (17:31 +0200)]
wayland: Introduce GdkFractionalScale type
We want to use it later for various things, this just adds the
infrastructure we will need.
Matthias Clasen [Sat, 1 Apr 2023 14:41:42 +0000 (14:41 +0000)]
Merge branch 'always_expose_showing' into 'main'
a11y: Set ATSPI_STATE_SHOWING for all widgets, not only for windows
Closes #5194
See merge request GNOME/gtk!5738
Matthias Clasen [Sat, 1 Apr 2023 14:14:31 +0000 (14:14 +0000)]
Merge branch 'matthiasc/for-main' into 'main'
inspector: Improve display of paths
See merge request GNOME/gtk!5766
Matthias Clasen [Sat, 1 Apr 2023 13:45:58 +0000 (09:45 -0400)]
inspector: Improve display of paths
The values in the path section are long and generally
ellipsized. It does not make sense to reserve extra
space that the labels don't need.
Matthias Clasen [Sat, 1 Apr 2023 13:51:40 +0000 (13:51 +0000)]
Merge branch 'wayland-details' into 'main'
inspector: Show Wayland protocols
See merge request GNOME/gtk!5765
Matthias Clasen [Sat, 1 Apr 2023 12:45:45 +0000 (08:45 -0400)]
wayland: Some debug spew tweaks
Matthias Clasen [Sat, 1 Apr 2023 12:45:05 +0000 (08:45 -0400)]
inspector: Show Wayland protocols
This could be useful for somebody.
Matthias Clasen [Sat, 1 Apr 2023 12:48:19 +0000 (12:48 +0000)]
Merge branch 'bilelmoussaoui-main-patch-24659' into 'main'
docs: Improve GtkLabel rendering
See merge request GNOME/gtk!5764
Nathan Follens [Sat, 1 Apr 2023 12:29:11 +0000 (12:29 +0000)]
Update Dutch translation
Bilal Elmoussaoui [Sat, 1 Apr 2023 12:06:11 +0000 (12:06 +0000)]
docs: Improve GtkLabel rendering
By adding some missing links & avoid the browser
from rendering the entities as their equivalent symbols
Benjamin Otte [Sat, 1 Apr 2023 11:39:32 +0000 (11:39 +0000)]
Merge branch 'wip/otte/fractional-scale' into 'main'
wayland: Add support for the fractional scale protocol
See merge request GNOME/gtk!5763
Benjamin Otte [Sat, 1 Apr 2023 10:48:26 +0000 (12:48 +0200)]
wayland: Add support for the fractional scale protocol
April fools!
No, really.
The fractional scale protocol is just a way to track the surface scale,
but not a way to draw fractional content.
This commit uses it for that, so tht we don't rely on tracking outputs.
This also allows magnifiers etc to send us a larger (integer) scale if
they would like that, that is not represented by the outputs.
Benjamin Otte [Sat, 1 Apr 2023 00:52:11 +0000 (00:52 +0000)]
Merge branch 'wip/otte/wayland-versions' into 'main'
wayland: Use proper get_version() functions
See merge request GNOME/gtk!5761
Benjamin Otte [Sat, 1 Apr 2023 00:21:47 +0000 (02:21 +0200)]
wayland: Use wl_seat_get_version()
Benjamin Otte [Sat, 1 Apr 2023 00:06:43 +0000 (02:06 +0200)]
wayland: Use zwp_pointer_gestures_v1_get_version()
Benjamin Otte [Sat, 1 Apr 2023 00:03:54 +0000 (02:03 +0200)]
wayland: Use gtk_shell1_get_version()
... or correct gtk_surface1_get_version() alternative.
Benjamin Otte [Fri, 31 Mar 2023 23:57:25 +0000 (01:57 +0200)]
wayland: Use wl_data_device_manager_get_version()
Benjamin Otte [Fri, 31 Mar 2023 23:53:52 +0000 (01:53 +0200)]
wayland: Use zxdg_output_manager_v1_get_version()
Benjamin Otte [Fri, 31 Mar 2023 23:44:28 +0000 (01:44 +0200)]
wayland: Remove unused variable
Also, Wayland has get_version() functions, so if we ever need it, we can
use that.
Benjamin Otte [Fri, 31 Mar 2023 23:39:47 +0000 (01:39 +0200)]
wayland: Check correct interface
buffer scale is a surface property, so check the version of the surface
interface, not the compositor one.
Benjamin Otte [Fri, 31 Mar 2023 23:28:46 +0000 (01:28 +0200)]
wayland: Use wl_compositor_get_version()
Wayland has functions to check versions, so use those.
Benjamin Otte [Fri, 31 Mar 2023 23:18:38 +0000 (01:18 +0200)]
wayland: Use proper macro
Wayland has macros to check required versions. Use those instead of
custom ones.
Matthias Clasen [Sat, 1 Apr 2023 00:17:12 +0000 (20:17 -0400)]
CODING-STYLE: Updates
We switched to using #pragma once in headers,
document that.
Matthias Clasen [Fri, 31 Mar 2023 23:52:01 +0000 (23:52 +0000)]
Merge branch 'pragma-once' into 'main'
Convert headers to #pragma once
See merge request GNOME/gtk!5759
Matthias Clasen [Fri, 31 Mar 2023 19:11:10 +0000 (15:11 -0400)]
Convert headers to #pragma once
The conversion was done by guard2one.
Georges Basile Stavracas Neto [Fri, 31 Mar 2023 17:00:33 +0000 (14:00 -0300)]
gsk/vulkan/renderpass: Factor out node implementations
This is mostly a cosmetic change, and the goal is twofold:
1. Make it easier to spot unimplemented render node types; and
2. Prepare for a small rework
The implementation for each node now lives in specific functions,
like the GL renderer; unlike the GL renderer, however, we use a
node type vtable to map GskRenderNodeType → implementation. Render
node without an implementation map to NULL, and use the fallback
implementation. Render nodes that fail any check and return FALSE
also use fallback implementation.
Benjamin Otte [Fri, 31 Mar 2023 15:58:03 +0000 (15:58 +0000)]
Merge branch 'wip/otte/for-main' into 'main'
various fixes
See merge request GNOME/gtk!5756
Benjamin Otte [Thu, 30 Mar 2023 06:29:32 +0000 (08:29 +0200)]
listbase: Clear any newly set adjustments
The scrolling code assumes the adjustment values are up to date or
it crashes and before we've run size_allocate() we haven't update them.
Fixes a crash in the gtk-demo scrollinfo that would set the adjustments
with random values (via ScrolledWindow.set_child()) and then scroll in a
tick callback right before the (first) size_allocate().
Benjamin Otte [Fri, 31 Mar 2023 15:34:15 +0000 (17:34 +0200)]
widget: Shortcut widget not repositioning
If a widget doesn't move positions during gtk_widget_reposition(),
detect it early.
This is especially beneficial in the inspector.
Matthias Clasen [Fri, 31 Mar 2023 13:25:30 +0000 (13:25 +0000)]
Merge branch 'gbsneto/easy-vulkan-fixes' into 'main'
Easy Vulkan cleanups and fixes
See merge request GNOME/gtk!5753
Alexander Shopov [Fri, 31 Mar 2023 10:04:26 +0000 (10:04 +0000)]
Update Bulgarian translation
(cherry picked from commit
3458ebf8c93f839cbf33caa48cf39ec112f292a2)
Matthias Clasen [Fri, 31 Mar 2023 01:54:52 +0000 (01:54 +0000)]
Merge branch 'more-property-notification' into 'main'
filedialog: Make filters nullable
See merge request GNOME/gtk!5755
Matthias Clasen [Fri, 31 Mar 2023 00:18:56 +0000 (20:18 -0400)]
testsuite: Check more property notification
Handle more value types.
Matthias Clasen [Fri, 31 Mar 2023 01:18:35 +0000 (21:18 -0400)]
Make adjustment setters behave
Matthias Clasen [Fri, 31 Mar 2023 00:18:19 +0000 (20:18 -0400)]
models: Fix up property notifications
We were emitting redundant notifications
for the ::model property.
Matthias Clasen [Fri, 31 Mar 2023 00:17:28 +0000 (20:17 -0400)]
filedialog: Make filters nullable
It should be possible to reset a property
to its default value.
Matthias Clasen [Thu, 30 Mar 2023 23:34:48 +0000 (23:34 +0000)]
Merge branch 'more-notify-tests' into 'main'
testsuite: Clean up some exclusions
See merge request GNOME/gtk!5752
Benjamin Otte [Thu, 30 Mar 2023 21:59:45 +0000 (21:59 +0000)]
Merge branch 'gbsneto/wayland-buffer-scale-creation' into 'main'
gdk/wayland/surface: Track and apply buffer scale
See merge request GNOME/gtk!5751
Matthias Clasen [Thu, 30 Mar 2023 21:32:38 +0000 (17:32 -0400)]
Make widget property setters behave
We want to allow setting a property to its
current value, while still having a precondition
for widget->parent being NULL otherwise.
Georges Basile Stavracas Neto [Thu, 30 Mar 2023 20:09:24 +0000 (17:09 -0300)]
gdk/vulkancontext: Accept Khronos validation layers
The Lunarg validation layers seem to have been deprecated in favour
of the Khronos ones. There's no reason not to have both, to accept
loading both - simultaneously, even.
Georges Basile Stavracas Neto [Thu, 23 Mar 2023 02:45:09 +0000 (23:45 -0300)]
gsk/vulkanglyphcache: Cleanup maths
A trivial cleanup to match what the GL renderer does
Georges Basile Stavracas Neto [Wed, 22 Mar 2023 01:06:04 +0000 (22:06 -0300)]
vulkan/glyphcache: Add padding around ink rect
This is what the GL renderer does, and it gets rid of the cutout
characters.
Georges Basile Stavracas Neto [Tue, 21 Mar 2023 19:16:17 +0000 (16:16 -0300)]
gdk/vulkancontext: Pass all painted rects
Instead of passing a single, potentially massive rectangle that is
just the extents of the damage rect, collect and pass all damage
rects individually.
Georges Basile Stavracas Neto [Tue, 21 Mar 2023 23:04:56 +0000 (20:04 -0300)]
gdk/wayland/surface: Track and apply buffer scale
Add a new flag to track whether buffer scale is dirty or not,
and centralize calling wl_surface_set_buffer_scale() in a single
place: gdk_wayland_surface_sync_buffer_scale().
gdk_wayland_surface_sync_buffer_scale() is only called by
gdk_wayland_surface_sync(), which itself is called by the GL,
Vulkan, and Cairo contexts, right before submitting a frame.
This ensure that each frame has an up-to-date buffer scale.
This mimics how opaque and input regions are tracked.
Matthias Clasen [Thu, 30 Mar 2023 16:43:21 +0000 (12:43 -0400)]
testsuite: Check more property notification
We can easily check some object types
such as widgets.
Matthias Clasen [Thu, 30 Mar 2023 13:05:33 +0000 (09:05 -0400)]
testsuite: Clean up some exclusions
Drop some exclusions from the notify test.
The tests work fine for these objects.
Matthias Clasen [Thu, 30 Mar 2023 18:12:54 +0000 (14:12 -0400)]
listitem: Fix a notification problem
We were notifying ::item when ::child is
changed. Oops
Lukáš Tyrychtr [Tue, 28 Mar 2023 13:07:03 +0000 (15:07 +0200)]
a11y: Set ATSPI_STATE_SHOWING for all widgets, not only for windows
According to the at-spi2 docs, for a widget to be considered visible,
it needs both the showing and visible states. Many applications rely on that,
for example the flat review functionality of Orca.
this fixes #5194
Matthias Clasen [Thu, 30 Mar 2023 02:45:56 +0000 (02:45 +0000)]
Merge branch 'matthiasc/for-main' into 'main'
emojichooser: Stop using gtk_widget_get_allocation
See merge request GNOME/gtk!5749
Matthias Clasen [Thu, 30 Mar 2023 01:13:59 +0000 (21:13 -0400)]
emojichooser: Stop using gtk_widget_get_allocation
Replace all uses with gtk_widget_compute_bounds.
Matthias Clasen [Wed, 29 Mar 2023 20:12:29 +0000 (20:12 +0000)]
Merge branch 'fix-popover-positioning' into 'main'
wayland: Fix corner cases in positioning
See merge request GNOME/gtk!5741
Matthias Clasen [Wed, 29 Mar 2023 12:05:58 +0000 (12:05 +0000)]
Merge branch 'matthiasc/for-main' into 'main'
Add some more keysyms tests
See merge request GNOME/gtk!5745
Matthias Clasen [Wed, 29 Mar 2023 01:04:10 +0000 (21:04 -0400)]
Add some more keysyms tests
Spot-check a few keypad symbols.
Matthias Clasen [Wed, 29 Mar 2023 11:34:27 +0000 (07:34 -0400)]
testsuite: Update a test
cacecd2fb54025a changed a warning message that
some tests check for. Oops.
Benjamin Otte [Wed, 29 Mar 2023 11:28:28 +0000 (11:28 +0000)]
Merge branch 'wip/otte/filechooser-fixes' into 'main'
filechooser fixes
See merge request GNOME/gtk!5746
Benjamin Otte [Wed, 29 Mar 2023 11:28:15 +0000 (11:28 +0000)]
Merge branch 'wip/otte/node-naming' into 'main'
node format: Allow naming textures and nodes
See merge request GNOME/gtk!5740
Benjamin Otte [Wed, 29 Mar 2023 04:41:23 +0000 (06:41 +0200)]
filechoosercell: Remove position property
Instead, query the position from the listitem
Benjamin Otte [Wed, 29 Mar 2023 04:28:04 +0000 (06:28 +0200)]
filechoosercell: Remove selected property
Instead, query the selected state from the listitem.
Benjamin Otte [Wed, 29 Mar 2023 04:26:03 +0000 (06:26 +0200)]
filechooser: Select via action
Don't fudge around poking through the listview, trying to get a model
and selecting it directly. Instead, use the proper way and activate the
"listitem.select" action.
Benjamin Otte [Wed, 29 Mar 2023 04:01:26 +0000 (06:01 +0200)]
listbase: Select via action
Instead of directly calling select_item(), trigger the select-item
action of the focused child.
We do this convoluted calling into the widget because that way
GtkListItem::selectable gets respected, which is what one would expect.
Plus, this code is usually triggered via keybindings, and this way the
ListBase keybindings work identical to the ListItem keybindings.
Matthias Clasen [Wed, 29 Mar 2023 02:23:46 +0000 (02:23 +0000)]
Merge branch 'wip/otte/trelistmodel-fixage' into 'main'
treelistmodel: Don't add items in reverse
Closes #5707
See merge request GNOME/gtk!5744
Benjamin Otte [Wed, 29 Mar 2023 00:38:17 +0000 (02:38 +0200)]
docs: Document additions to the node format
Benjamin Otte [Tue, 28 Mar 2023 22:12:59 +0000 (00:12 +0200)]
testsuite: Add parsing tests for node and texture naming
Benjamin Otte [Tue, 28 Mar 2023 21:47:49 +0000 (23:47 +0200)]
rendernodeparser: Detect duplicates and print them by name
If we encounter a node or texture the 1st time and they are going
to be used again, give them a name.
Then, when encountering them again, print them by name instead
of duplicating them.
Benjamin Otte [Tue, 28 Mar 2023 21:58:50 +0000 (23:58 +0200)]
rendernodeparser: Add support for reusing nodes
We extend the syntax for nodes from:
<node-type> { ... }
to
<node-type> { ... }
<node-type> <string> { ... }
<string>;
where the first is the same as before, the 2nd defines a named node and
the last references a previously defined node.
Or to give an example:
color "node" {
bounds: 0 0 10 10;
color: red;
}
transform {
bounds: 20 0 10 10;
child: "node";
}
This will draw the red box twice, once at (0,0) and once at
(20,0).
The intended use for this is both shortening generated node files as
well as allowing to write tests that reuse nodes, in particular when
dealing with caches.
Benjamin Otte [Tue, 28 Mar 2023 19:54:26 +0000 (21:54 +0200)]
rendernodeparser: Add support for reusing textures
We extend the syntax for textures from just:
<url>
to
[<string>] <url>
<string>
where the first defines a named texture while the second references a
texture.
Or to give an example:
texture {
bounds: 0 0 10 10;
texture: "foo" url("foo.png");
}
texture {
bounds: 20 0 10 10;
texture: "foo";
}
This will draw the texture "foo.png" twice, once at (0,0) and once at
(20,0).
The intended use for this is both shortening generated node files as
well as allowing to write tests that reuse textures, in particular when
mixing them in texture and texture-scale nodes.
Benjamin Otte [Tue, 28 Mar 2023 19:18:46 +0000 (21:18 +0200)]
rendernodeparser: Add a Context object
... and pass it through all the parsing functions.
So far it's unused, this is just the plumbing.
Benjamin Otte [Tue, 28 Mar 2023 21:30:30 +0000 (23:30 +0200)]
rendernodeparser: Split out a function
This code was copy/pasted, so unify it.
Benjamin Otte [Wed, 29 Mar 2023 00:28:01 +0000 (02:28 +0200)]
rendernodeparser: Emit error when failing to resolve URL
Benjamin Otte [Tue, 28 Mar 2023 19:09:01 +0000 (21:09 +0200)]
rendernodeparser: Failing to parse a string is an error
Testcase included.
Benjamin Otte [Wed, 29 Mar 2023 01:52:44 +0000 (03:52 +0200)]
testsuite: Fix broken test
The test was referencing a nonexisting image.
Plus, node parsing cannot reference relative URLs.
Kévin Commaille [Tue, 28 Mar 2023 20:18:09 +0000 (22:18 +0200)]
Add a test for splicing treelistmodel
Benjamin Otte [Wed, 29 Mar 2023 00:56:47 +0000 (02:56 +0200)]
treelistmodel: Don't add items in reverse
This was broken since commit
bf55685000fd744a26eec61c07fd8aa3d084d54c
where we started to track items.
Fixes #5707
Matthias Clasen [Wed, 29 Mar 2023 00:23:38 +0000 (20:23 -0400)]
wayland: Fix corner cases in positioning
We were not handling some cases correctly.
This was making the dropdown in the gtk-demo
image-scaling demo appear in the top left
corner.
Matthias Clasen [Tue, 28 Mar 2023 15:36:34 +0000 (15:36 +0000)]
Merge branch 'wayland-popup-anchor' into 'main'
wayland: Comply with protocol requirements
See merge request GNOME/gtk!5723
Alexandre Franke [Tue, 28 Mar 2023 10:25:01 +0000 (10:25 +0000)]
Update French translation
Matthias Clasen [Tue, 28 Mar 2023 10:19:31 +0000 (10:19 +0000)]
Merge branch 'matthiasc/for-main' into 'main'
gdk: Improve logging for backends
Closes #5704
See merge request GNOME/gtk!5737